Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added populate aap vars #255

Closed

Conversation

resoluteCoder
Copy link
Collaborator

Description

  • Changed the interface for populating aap with ssh keys and default user/ip. This way the user can run the role without having to edit defaults.
  • Also gives an easier interface to provide correct info.
  • Updated docs

FIXES:
#213

Type of change

What is it?

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation update
  • Tests update
  • Refactor

Checklist

  • Added changelog fragment
  • Tests exist for affected features covering positive and negative scenarios

@mergify mergify bot added the waiting for review Pull request is ready for review label Jul 18, 2023
Copy link
Collaborator

@chadmf chadmf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to fix the ssh_key_data line in the populate_aap/tasks/main.yml

username: user
ssh_key_data: "{{ lookup('file', '/home/user/.ssh/id_rsa') }}"
username: "{{ populate_aap_default_host_user }}"
ssh_key_data: "{{ lookup('file', populate_aap_ssh_key_path) if populate_aap_ssh_key_path is defined else '' }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be just the var {{ populate_aap_ssh_key_path }} and the role should contain all of the non variable information and then this would close the other issue #213
This is a best practice that the defaults should be vars not logic.

username: user
ssh_key_data: "{{ lookup('file', '/home/user/.ssh/id_rsa') }}"
username: "{{ populate_aap_default_host_user }}"
ssh_key_data: "{{ lookup('file', populate_aap_ssh_key_path) if populate_aap_ssh_key_path is defined else '' }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ssh_key_data: "{{ lookup('file', populate_aap_ssh_key_path) if populate_aap_ssh_key_path is defined else '' }}"
ssh_key_data: "{{ populate_aap_ssh_key_path }}"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in addition to above you will need to change the role main task to have the lookup

@mergify
Copy link
Contributor

mergify bot commented Jul 19, 2023

This Pull Request needs all conversation threads to be resolved. Could you fix it @resoluteCoder? 🙏

@mergify mergify bot added the question Further information is requested (all conversations resolved?) label Jul 19, 2023
@mergify
Copy link
Contributor

mergify bot commented Jul 19, 2023

This Pull Request needs all changes requested to be resolved. Could you fix it @resoluteCoder? 🙏

@mergify mergify bot added the changes requested Review requests changes to PR label Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes requested Review requests changes to PR question Further information is requested (all conversations resolved?) waiting for review Pull request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants